<?php
	function getInfoUserModel()
	{
		$string = file_get_contents("http://localhost/zingmesdk/model/webservice/get_info_user.php?userIdZing=".$_SESSION['userIdZing']);
		$json = json_decode($string);
		foreach($json as $key => $value) {
			if(strcmp($key,'success')==0){
                if($value==1){
					return true;
				}
				else{
					return false;
				}
			}
		}
	}
	function insertUserModel(){
		$userDisplayZing = str_replace(' ','+',$_SESSION['userDisplayZing']);
		$stringGet = "userIdZing=".$_SESSION['userIdZing']."&userNameZing=".$_SESSION['userNameZing']
					."&avatar=".$_SESSION['userAvatarZing']."&userDisplayZing=".$userDisplayZing;
		$string = file_get_contents("http://localhost/zingmesdk/model/webservice/insert_user.php?".$stringGet);
		$string = trim($string);
		$json = json_decode($string);
			if($json->success == 1){
					return true;
				}
				else{
					return false;
				}
	}

?>